Integrand size = 15, antiderivative size = 60 \[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right ) \]
arctanh((a+b*cot(x)^2)^(1/2)/a^(1/2))*a^(1/2)-arctanh((a+b*cot(x)^2)^(1/2) /(a-b)^(1/2))*(a-b)^(1/2)
Time = 0.03 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00 \[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right ) \]
Sqrt[a]*ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a]] - Sqrt[a - b]*ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a - b]]
Time = 0.27 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.08, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.533, Rules used = {3042, 25, 4153, 25, 354, 94, 73, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan (x) \sqrt {a+b \cot ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {\sqrt {a+b \tan \left (x+\frac {\pi }{2}\right )^2}}{\tan \left (x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\sqrt {b \tan \left (x+\frac {\pi }{2}\right )^2+a}}{\tan \left (x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \int -\frac {\tan (x) \sqrt {a+b \cot ^2(x)}}{\cot ^2(x)+1}d\cot (x)\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\sqrt {b \cot ^2(x)+a} \tan (x)}{\cot ^2(x)+1}d\cot (x)\) |
\(\Big \downarrow \) 354 |
\(\displaystyle -\frac {1}{2} \int \frac {\sqrt {b \cot ^2(x)+a} \tan (x)}{\cot ^2(x)+1}d\cot ^2(x)\) |
\(\Big \downarrow \) 94 |
\(\displaystyle \frac {1}{2} \left ((a-b) \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot ^2(x)-a \int \frac {\tan (x)}{\sqrt {b \cot ^2(x)+a}}d\cot ^2(x)\right )\) |
\(\Big \downarrow \) 73 |
\(\displaystyle \frac {1}{2} \left (\frac {2 (a-b) \int \frac {1}{\frac {\cot ^4(x)}{b}-\frac {a}{b}+1}d\sqrt {b \cot ^2(x)+a}}{b}-\frac {2 a \int \frac {1}{\frac {\cot ^4(x)}{b}-\frac {a}{b}}d\sqrt {b \cot ^2(x)+a}}{b}\right )\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {1}{2} \left (2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-2 \sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )\right )\) |
(2*Sqrt[a]*ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a]] - 2*Sqrt[a - b]*ArcTanh[S qrt[a + b*Cot[x]^2]/Sqrt[a - b]])/2
3.1.21.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ {p = Denominator[m]}, Simp[p/b Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL inearQ[a, b, c, d, m, n, x]
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_] :> Simp[(b*e - a*f)/(b*c - a*d) Int[(e + f*x)^(p - 1)/(a + b*x), x], x] - Simp[(d*e - c*f)/(b*c - a*d) Int[(e + f*x)^(p - 1)/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && LtQ[0, p, 1]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Leaf count of result is larger than twice the leaf count of optimal. \(193\) vs. \(2(48)=96\).
Time = 7.15 (sec) , antiderivative size = 194, normalized size of antiderivative = 3.23
method | result | size |
default | \(\frac {\sqrt {4}\, \sin \left (x \right ) \left (\sqrt {a}\, \operatorname {arctanh}\left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {a}}\right ) \sqrt {-a +b}+\arctan \left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {-a +b}}\right ) a -\arctan \left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {-a +b}}\right ) b \right ) \sqrt {a +b \cot \left (x \right )^{2}}}{2 \sqrt {-a +b}\, \left (\cos \left (x \right )+1\right ) \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}}\) | \(194\) |
1/2*4^(1/2)/(-a+b)^(1/2)*sin(x)*(a^(1/2)*arctanh(1/a^(1/2)*(-(a*cos(x)^2-c os(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(cot(x)+csc(x)))*(-a+b)^(1/2)+arctan(1/(- a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(cot(x)+csc(x)) )*a-arctan(1/(-a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)* (cot(x)+csc(x)))*b)*(a+b*cot(x)^2)^(1/2)/(cos(x)+1)/(-(a*cos(x)^2-cos(x)^2 *b-a)/(cos(x)+1)^2)^(1/2)
Time = 0.29 (sec) , antiderivative size = 351, normalized size of antiderivative = 5.85 \[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\left [\frac {1}{2} \, \sqrt {a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b\right ) + \frac {1}{2} \, \sqrt {a - b} \log \left (\frac {{\left (2 \, a - b\right )} \tan \left (x\right )^{2} - 2 \, \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2} + 1}\right ), -\sqrt {-a + b} \arctan \left (-\frac {\sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{a - b}\right ) + \frac {1}{2} \, \sqrt {a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b\right ), -\sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{a}\right ) + \frac {1}{2} \, \sqrt {a - b} \log \left (\frac {{\left (2 \, a - b\right )} \tan \left (x\right )^{2} - 2 \, \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2} + 1}\right ), -\sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{a}\right ) - \sqrt {-a + b} \arctan \left (-\frac {\sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{a - b}\right )\right ] \]
[1/2*sqrt(a)*log(2*a*tan(x)^2 + 2*sqrt(a)*sqrt((a*tan(x)^2 + b)/tan(x)^2)* tan(x)^2 + b) + 1/2*sqrt(a - b)*log(((2*a - b)*tan(x)^2 - 2*sqrt(a - b)*sq rt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)^2 + b)/(tan(x)^2 + 1)), -sqrt(-a + b) *arctan(-sqrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)/(a - b)) + 1/2*sqrt( a)*log(2*a*tan(x)^2 + 2*sqrt(a)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)^2 + b), -sqrt(-a)*arctan(sqrt(-a)*sqrt((a*tan(x)^2 + b)/tan(x)^2)/a) + 1/2*sq rt(a - b)*log(((2*a - b)*tan(x)^2 - 2*sqrt(a - b)*sqrt((a*tan(x)^2 + b)/ta n(x)^2)*tan(x)^2 + b)/(tan(x)^2 + 1)), -sqrt(-a)*arctan(sqrt(-a)*sqrt((a*t an(x)^2 + b)/tan(x)^2)/a) - sqrt(-a + b)*arctan(-sqrt(-a + b)*sqrt((a*tan( x)^2 + b)/tan(x)^2)/(a - b))]
\[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\int \sqrt {a + b \cot ^{2}{\left (x \right )}} \tan {\left (x \right )}\, dx \]
\[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\int { \sqrt {b \cot \left (x\right )^{2} + a} \tan \left (x\right ) \,d x } \]
Leaf count of result is larger than twice the leaf count of optimal. 187 vs. \(2 (48) = 96\).
Time = 0.33 (sec) , antiderivative size = 187, normalized size of antiderivative = 3.12 \[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\frac {1}{2} \, {\left (\frac {2 \, \sqrt {a - b} a \arctan \left (\frac {{\left (\sqrt {a - b} \sin \left (x\right ) - \sqrt {a \sin \left (x\right )^{2} - b \sin \left (x\right )^{2} + b}\right )}^{2} - 2 \, a + b}{2 \, \sqrt {-a^{2} + a b}}\right )}{\sqrt {-a^{2} + a b}} + \sqrt {a - b} \log \left ({\left (\sqrt {a - b} \sin \left (x\right ) - \sqrt {a \sin \left (x\right )^{2} - b \sin \left (x\right )^{2} + b}\right )}^{2}\right )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) - \frac {{\left (2 \, \sqrt {a - b} a \arctan \left (-\frac {a - b}{\sqrt {-a^{2} + a b}}\right ) + \sqrt {-a^{2} + a b} \sqrt {a - b} \log \left (b\right )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{2 \, \sqrt {-a^{2} + a b}} \]
1/2*(2*sqrt(a - b)*a*arctan(1/2*((sqrt(a - b)*sin(x) - sqrt(a*sin(x)^2 - b *sin(x)^2 + b))^2 - 2*a + b)/sqrt(-a^2 + a*b))/sqrt(-a^2 + a*b) + sqrt(a - b)*log((sqrt(a - b)*sin(x) - sqrt(a*sin(x)^2 - b*sin(x)^2 + b))^2))*sgn(s in(x)) - 1/2*(2*sqrt(a - b)*a*arctan(-(a - b)/sqrt(-a^2 + a*b)) + sqrt(-a^ 2 + a*b)*sqrt(a - b)*log(b))*sgn(sin(x))/sqrt(-a^2 + a*b)
Time = 13.78 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.15 \[ \int \sqrt {a+b \cot ^2(x)} \tan (x) \, dx=\mathrm {atanh}\left (\frac {2\,a\,b^3\,\sqrt {a-b}\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{2\,a\,b^4-2\,a^2\,b^3}\right )\,\sqrt {a-b}+\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{\sqrt {a}}\right ) \]